<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
	<%@ include file="/static/include/common.inc"%>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>青州市名卡管理系统</title>
    <link rel="stylesheet" href="static/admin/css/layui.css">
    <link rel="stylesheet" href="static/admin/css/login.css">
    <script type="text/javascript" src="static/js/jquery-1.11.2.js"></script> 
</head>
<body background="static/admin/img/login-bg4.jpg">
<div class="layui-carousel video_mask" id="login_carousel" >
    <div carousel-item>
        <div class="carousel_div1"></div>
        <!-- <div class="carousel_div2"></div>
        <div class="carousel_div3"></div> -->
    </div>
    <div class="login layui-anim layui-anim-up">
        <p><h1>青州市民卡管理系统</h1></p>
        <form class="layui-form" action="" method="post">
            <div class="layui-form-item">
                <input type="text" name="username" lay-verify="required" placeholder="请输入账号" autocomplete="off"  value="" class="layui-input">
            </div>
            <div class="layui-form-item">
                <input type="password" name="password" lay-verify="required" placeholder="请输入密码" autocomplete="off" value="" class="layui-input">
            </div>
            <!-- <div class="layui-form-item form_code">
                <input class="layui-input" name="code" placeholder="验证码" lay-verify="required" type="text" autocomplete="off">
                <div class="code"> 
                	<div id="v_container"><img src="admin/captcha.do" width="116" height="36"></div>
		        </div>
            </div> -->
            <button class="layui-btn login_btn" lay-submit="" lay-filter="login" id="loginSys">登录系统</button>
        </form>
    </div>
</div>
<script type="text/javascript">
	/**重新生成验证码*/
	function reqCaptcha() {
	    var url = "admin/captcha.do?nocache=" + new Date().getTime();
	    $('.code img').attr("src",url)
	}
	/**点击验证码重新生成*/
	$('.code img').on('click', function () {
	    reqCaptcha();
	});
	$("#loginSys").on('click', function () {
		//记录ajax请求返回值
        var ajaxReturnData;
		//alert($("form").serialize())
        //登陆验证
        $.ajax({
            url: 'admin/loginCheck.do',
            type: 'post',
            async: false,
            data: $("form").serialize(),
            success: function (data) {
                ajaxReturnData = data;
            }
        });
        //登陆成功
        if(ajaxReturnData.code==1){
        	window.location.href="admin/index.do";
        	return false;
        }else{
        	var url = "admin/captcha.do?nocache=" + new Date().getTime();
        	$('.code img').attr("src",url)
        	alert(ajaxReturnData.msg);
        	return false;
        }
	})
	
	
</script>
</body>
</html>